package com.lagou.util;

import java.io.IOException;

/**
 * @ClassName Serializer
 * @Deseription TODO
 * @Author fx
 * @Date 2021/3/3 0003 11:21
 * @Version 1.0
 **/
public interface Serializer {

    /**
     * java对象转换为二进制
     * @param object
     * @return
     */
    byte[] serialize(Object object) throws IOException;



    /**
     * 二进制转换成java对象
     * @param clazz
     * @param bytes
     * @return
     */
    <T> T deserialize(Class<T> clazz, byte[] bytes) throws IOException;
}
